---- 子程序及子程序调用语句

-- 【过程procedure】

architecture A of examp is

procedure min(x, y: in std_logic; signal dout: out std_logic) is
    variable sc: std_logic;
begin
    if x < y then sc := x;
    else sc := y;
    dout <= sc;
end min;

begin
    process(a, b, c)
    begin
        min(a, b, c);
    end process
end A;

-- 【函数】 --

function min(x, y: integer) return integer is
    begin
        if x < y then return x;
        else return y;
        end if
    end min;

